<script>
    var topRole = [1, 6];
    // 所属角色
    function show_sub(val) {
        var role = parseInt(val);
        console.log(role, typeof role, $.inArray(role, [1, 6]));
        // 超管、管理员
        if ($.inArray(role, topRole) > -1) {
            $('.manager').addClass('noneDesc');
        } else {
            $('.manager').removeClass('noneDesc');
        }
        $('#manager').prop('selectedIndex', 0);
    }

    // 手动提交表单
    $('#handSubmit').click(function () {
        var roleVal = parseInt($('#role option:selected').val());
        console.log(roleVal, topRole);
        // 非超管、管理员，需选择员工
        if ($.inArray(roleVal, topRole) <= -1) {
            var managerVal = parseInt($('#manager option:selected').val());
            console.log(managerVal);
            if (!managerVal) {
                return toastr.error('请选择部门员工');
            }
        }
        $('#myForm').submit();
    });
</script>